package com.zys.http.processor.basic;


import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;

import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author zys
 * @since 2025-07-22
 */
public interface ProjectProcessor {

    default Collection<Module> projectModules(Project project) {
        Module[] modules = ModuleManager.getInstance(project).getModules();
        Map<String, Module> map = Arrays.stream(modules).collect(Collectors.toMap(Module::getName, v -> v));
        return map.values();
    }
}
